import Vue from 'vue';
import VueI18n from 'vue-i18n';

Vue.use(VueI18n);

// 定义语言包
const messages = {
  en: {
    dialog: {
      publish: {
        title: 'Publish Post',
        form: {
          title: {
            label: 'Title'
          },
          content: {
            label: 'Content'
          },
          category: {
            label: 'Category',
            experienceSharing: 'Experience Sharing',
            emotionalExchange: 'Emotional Exchange',
            medicalHelp: 'Medical Help'
          },
          uploadImage: {
            label: 'Upload Image'
          }
        },
        footer: {
          cancel: 'Cancel',
          publish: 'Publish'
        }
      }
    }
  },
  zh: {
    dialog: {
      publish: {
        title: '发布帖子',
        form: {
          title: {
            label: '标题'
          },
          content: {
            label: '内容'
          },
          category: {
            label: '分类',
            experienceSharing: '经验分享',
            emotionalExchange: '情感交流',
            medicalHelp: '病情求助'
          },
          uploadImage: {
            label: '上传图片'
          }
        },
        footer: {
          cancel: '取消',
          publish: '发布'
        }
      }
    }
  }
};

// 创建VueI18n实例
const i18n = new VueI18n({
  locale: 'zh', // 设置默认语言
  messages
});

export default i18n;